/*
 * @Author: wangjing wangjin122@qq.com
 * @Date: 2024-02-22 15:27:16
 * @LastEditors: wangjing wangjin122@qq.com
 * @LastEditTime: 2024-02-22 16:33:21
 * @FilePath: \枚举类型\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// 数字枚举
var Color;
(function (Color) {
    Color[Color["red"] = 0] = "red";
    Color[Color["green"] = 5] = "green";
    Color[Color["blue"] = 6] = "blue";
})(Color || (Color = {}));
console.log(Color);
var code = 0;
if (code === 0 /* Types.suc */) { }
// 反向映射
var ReTypes;
(function (ReTypes) {
    ReTypes[ReTypes["fir"] = 0] = "fir"; // 数字才能进行反向映射
    // fir = '1' // 字符串不行，会报错
})(ReTypes || (ReTypes = {}));
var res = ReTypes.fir;
var key = ReTypes[res];
console.log('value:', res);
console.log('key:', key);
